//
//  SportTopicSliderCell.m
//  IfengNews
//
//  Created by tianhongyin on 14-5-20.
//
//

#import "SportTopicSubSliderCell.h"
#import "UIImageView+WebCache.h"

@interface SportTopicSubSliderCell()

@property (nonatomic,strong)UIImageView *imgview;
@property (nonatomic,assign)float imgWidth;
@property (nonatomic,assign)float imgHeight;


@end

@implementation SportTopicSubSliderCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        _imgWidth = 105;
        _imgHeight = 84;
    }
    return self;
}

- (void)setupSubView
{
    [self createImgView];
}

- (void)createImgView
{
    if(!_imgview){
        UIImageView *view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, _imgWidth, _imgHeight)];
        view.backgroundColor = [UIColor clearColor];
        //[view setPlaceholderImage:ICurrentTheme.sportTopicStyle.sportSlideImgDefaultImg];
        [self addSubview:view];
        self.imgview = view;
    }
    [_imgview sd_setImageWithURL:_url?[NSURL URLWithString:self.url]:nil placeholderImage:[UIImage imageNamed:@"index_slide_default.png"]];
}

- (void)setupSubViewWithWidth:(float)width height:(float)height{
    _imgWidth = width;
    _imgHeight = height;
    [self createImgView];
}
@end
